// 导入request.js请求工具类
import request from "@/utils/request.js";

export const getFoodTypeService = () => {
  return request.get("/type/all");
};

//根据参数查询食物
export const getFoodByQueryService = (pageFoodDto) => {
  return request.post("/food/query", pageFoodDto);
};

export const getFoodDetailService = (id) => {
  return request.get(`/food/${id}`);
};
// 根据食品ID列表获取营养成分
export const getFoodNutritionService = (foodIds) => {
  return request.post("/food/nutrition", foodIds);
};
//根据关键词查找
// 根据关键词查找
export const getFoodByKeywordService = (keyword) => {
  return request.get(`/food/searchFood`, {
    params: { keyword },
  });
};

//推荐食物
export const getRecommendFoodService = (foodRecommendPageDto) => {
  return request.post("/food/recommend", foodRecommendPageDto);
};


